<!--
 * @Descripttion: 
 * @Version: 
 * @Author: gaohj
 * @Date: 2022-12-21 11:42:27
 * @LastEditors: Please set LastEditors
 * @LastEditTime: 2022-12-21 11:46:47
-->
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <!-- 按位异或 -->

    <!-- 5  -->
    <!-- 9 -->

    <script>
        // 5 -> 0101 换成2进制
        // 9 -> 1001
        // 0101 -> 左侧补0上下对齐
        // 1001
        // 1100 -> 上下相同为0 不同为1
        // 1100 -> 12

        // alert(5^9);
        var num1 = 10;
        var num2 = 20;
        num1 = num1 ^ num2;
        num2 = num1 ^ num2;
        num1 = num1 ^ num2;
        console.log(num1, num2);
    </script>
</body>
</html>